<h2>Listing Users</h2>

<p id="instruction">
	<b>Create a User</b>:  If a user isn't listed who should be, you can create their user information and send them login information using the following link.
	<br />
		<%= link_to "Invite Users", :action => "invite" %> 
</p>

<table>
  <tr>
		<th>Name</th>
		<th>Email</th>
		<th>Site</th>
		<th>Roles</th>
		<th>Actions</th>
  </tr>
  
<% for user in @accounts %>
  <tr>
    <td><%=h user.display_name %></td>
    
	<td><%= mail_to user.email %></td>
	
    <td><%=h user.site.name %></td>
    <td><%=h user.roles.map {|r| "#{r.name} "} %></td>
                                 
    <td>
	
      <%= link_to 'Show', :action => 'show', :id => user.id %>   
	    
			<% if current_user.is_admin? -%>
      <%= link_to 'Edit', :action => 'edit', :id => user.id %>
			<% end -%>
			
	  </td>
  </tr>
<% end %>
</table>
